package com.kjtpay.design_pattern.observer;

class StockObserver extends Observer {
    public StockObserver(String name) {
        super(name);
        action = "没有发现人来，" + name + "在看股票行情";
    }

    @Override
    public void update(String subjectState) {
        if (subjectState == "老板") {
            action = "老板来了，" + name + "关闭股票行情，继续工作！";
        } else if (subjectState == "秘书") {
            action = "秘书来了，" + name + "可以继续看股票行情";
        } else {
            // 不知道谁来了，不操作
        }
    }
}
